//
//  WebServices.m
//  Love2Shop
//
//  Created by harveynash on 8/15/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "WebServices.h"
// #import "ClientCertificate.h"

@implementation WebServices


+ (NSData *) getXmlDataHttp:(NSString *) strUrl
{
	ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:strUrl]];	
	
	[request setTimeOutSeconds:REQUEST_TIMEOUT_SECONDS];
	[request startSynchronous];	 	
	NSError *error = [request error];
	if (!error) {
		// NSLog(@"%@", [request responseString]);
		return [request responseData];
	}
	NSLog(@"URL: %@, with des: %@", strUrl, [error localizedDescription]);
	return nil;	 	
}

+ (NSData *) loginWithURL:(NSString *) strUrl
{
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:strUrl]];	
	
	[request setTimeOutSeconds:REQUEST_TIMEOUT_SECONDS];
	[request startSynchronous];	 	
	NSError *error = [request error];
	if (!error) {
		// NSLog(@"%@", [request responseString]);
		return [request responseData];
	}
	NSLog(@"URL: %@, with des: %@", strUrl, [error localizedDescription]);
	return nil;	
}

@end
